#include <stdio.h>
#include <math.h>

int main(void)
{
    int a = 0;
    int b = 0;
    int ret = 0;

    printf("please input two int number:\n");
    scanf("%d %d", &a, &b);
    ret = pow(a, b);
    printf("%d\n", ret);

    printf("%d\n", ret%1000);

    return 0;
}